<%-- 
    Document   : BMatrimonio
    Created on : 05-oct-2013, 10:04:23
    Author     : WALDIR
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="/RegCivil/css/estilos.css">
        <script type="text/javascript" src="/RegCivil/datepicker/jquery-1.9.1.js"></script>
        <title>IMPRIMIR MATRIMONIO</title>
        <script type="text/javascript">
            if (window.ActiveXObject) {
                var obj = new ActiveXObject("Microsoft.XMLHTTP");
            }
            if (window.XMLHttpRequest) {
                var obj = new XMLHttpRequest();
            }
            function buscar()
            {
                $("#contBusqueda").show();
                var actaP = document.getElementById("nap").value;
                var actaM = document.getElementById("nam").value;
               
               
                var ndem = document.getElementById("ndepm").value;
                var nprm = document.getElementById("nprom").value;
                var ndim = document.getElementById("ndism").value;
                
                var nom=document.getElementById("nom").value;
                var ap1=document.getElementById("ape1").value;
                var ap2=document.getElementById("ape2").value;
                
                var bt = document.getElementById("boton").value;
                var txt = "btn1=" + bt + "&NAP=" + actaP + "&NAM=" + actaM + "&nombre=" +nom+"&ape1=" + ap1+"&ape2="+ap2+"&ndepm="+ndem+"&nprom="+nprm+"&ndism="+ndim;
                obj.onreadystatechange = res_bus;
                obj.open("post", "${pageContext.request.contextPath}/BusquedaMatrimonio", true);
                obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                obj.send(txt);
            }
            function res_bus() {
                if (obj.readyState == 4)
                {
                    var x = obj.responseText;
                    $("#RSBus").html(x);
                }
            }
            function filtrar()
            {
                var x = document.getElementById("VBus").value;
                if (x == "nroActa")
                {
                    document.getElementById("boton").setAttribute("value", "ActaPersonal");
                }
                if (x == "nroActaM")
                {
                    document.getElementById("boton").setAttribute("value", "ActaMatrimonial");
                }
                if (x == "idUbiM")
                {
                    document.getElementById("boton").setAttribute("value", "UbigeoM");
                }
                if (x == "Nombres")
                {
                    document.getElementById("boton").setAttribute("value", "Nombres");
                }
            }
            $(document).ready(function() {
                $("#contBusqueda").hide();
            });
        </script>
        <script type="text/javascript">
            function opened(ident)
            {
                var idM = ident.value;
                var txt = "btn1=buscar&NAP=''&NAM=''&idU=''&idUM=''&ruta=" + idM;
                obj.onreadystatechange = function() {
                    if (obj.readyState == 4)
                    {
                        document.location("RegCivil/Actas/"+obj.responseText);
                    }
                };
                obj.open("post", "${pageContext.request.contextPath}/BusquedaMatrimonio", true);
                obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                obj.send(txt);
            }
            
            function muestravalor(oo)
            {
                var vv=oo.value;
                var op=confirm("desea ver acta nro "+ vv);
                if(op)
                    {
                        open('/RegCivil/jsp/VistaAniMatrimonio.jsp?ref='+vv,'Sizewindow', 'width=1300,,height=800,status=yes,menubar=0,scrollbars=1,toolbar=no,location=0,directories=1,left=0,top=0,resizable=1,border=1px')
                    }
                
            }
        </script>
    </head>
    <body>
        <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;width: 850px;text-align: center;" class="contacto">
            <tr><td>                    
                    <fieldset style="alignment-baseline: central;margin-left: auto;margin-right: auto;" >
                        <legend style="border: 1px solid #dce0e3;background-color: #edf1f5">
                            BUSQUEDA DE MATRIMONIO</legend>
                        <table border="0">
                            <tr>
                                <td>
                                    <fieldset style="width:800px;margin-left: auto;margin-right: auto;width: 750px;"><legend style="font-weight: bold;">BUSQUEDA</legend>
                                        <table border="0">
                                            <tr>
                                                <td><label style="width:150px;text-align: right;padding-right: 10px;"/>Forma De Buqueda </td>
                                                <td><select name="bus"  id="VBus" style="padding: 7px 6px;
                                                            width: 200px;
                                                            border: 1px solid #CED5D7;
                                                            resize: none;
                                                            box-shadow:0 0 0 3px #EEF5F7;
                                                            margin: 5px 0;
                                                            text-transform: uppercase;" onchange="filtrar()" >
                                                        <option value="nroActa" selected>NRO_ACTA_PERS</option>
                                                        <option value="nroActaM">NRO_ACTA_MAT</option>
                                                        <option value="idUbiM">IDUBIGEO_MAT</option>
                                                        <option value="Nombres">NOMBRES</option>
                                                    </select>
                                                </td>
                                                <td><label style="width:150px;text-align: right;padding-right: 10px;"/>Nro Acta Personal  </td>
                                                <td><input type='text' name='NAP' id='nap' style='width:180px;'></td>
                                            </tr>
                                            <tr>
                                                <td><label style="width:150px;text-align: right;padding-right: 10px;" />Nro Acta Matrimonial </td>
                                                <td><input type='text' name='NAM' id='nam' style='width:180px;'></td>
                                            </tr>
                                            <tr >
                                                <td colspan="6">
                                                    <fieldset style="padding-left:20px;margin-top: 10px;margin-left: auto;margin-right: auto;">
                                                        <legend style="font-weight: bold;">Ubigeo Matrimonial</legend>
                                                        <table border="0">
                                                            <tr>
                                                                <td><label/>Dep &nbsp;<input type="text" name="ndepm" id="ndepm" style="width: 170px;" ></td>
                                                                <td><label/>Prov &nbsp;<input type="text" name="nprovm" id="nprom" style="width: 170px;"></td>
                                                                <td><label/>Dist &nbsp;<input type="text" name="ndistm" id="ndism" style="width: 170px;" ></td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="6">
                                                    <fieldset style="padding-left:20px;margin-top: 10px;margin-left: auto;margin-right: auto;">
                                                        <legend style="font-weight: bold;">Nombres</legend>
                                                        <table border="0">
                                                            <tr>
                                                                <td><input type="text" name="nombre" id="nom" placeholder="Nombre..." style="width: 200px;" ></td>
                                                                <td><input type="text" name="ape1" id="ape1" placeholder="Apellido Paterno ..."  style="width: 200px;"></td>
                                                                <td><input type="text" name="ape2" id="ape2" placeholder="Apellido Materno ..." style="width: 200px;"></td>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </fieldset>
                                                </td>
                                            </tr>
                                            <tr >
                                                <td colspan="4" style="text-align: center;"><button type="button" name="btn1" id="boton" value="ActaPersonal"  class="boton" style="width: 500px;" onclick="buscar()">Bucar</button></td>
                                            </tr>
                                        </table>
                                    </fieldset>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
        </table>
        <table align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px;width: 950px;padding-top: 15px; " class="contacto" id="contBusqueda" >
            <tr>
                <td><center><h1>RESULTADOS DE LA BUSQUEDA DE MATRIMONIO</h1></center>    
            <fieldset id="RSBus" style="margin-top:5px;">
            </fieldset>
        </td>
    </tr>
    </table>
</body>
</html>
